<h:form id="formGestor"
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui"
        xmlns:pe="http://primefaces.org/ui/extensions"
        xmlns:f="http://java.sun.com/jsf/core">

    <script language="JavaScript" src = "scripts/script.js"/>

    <h:panelGrid columns="3" >
        <h:panelGroup>
            <h:outputText value="Nome" /><br/>
            <p:inputText value="#{gestorBean.gestor.nome}"
                         styleClass="up"
                         style="width: 200px"
                         required="true"
                         maxlength="80"/><br/>
        </h:panelGroup>
        <h:panelGroup>
            <h:outputText value="CPF" /><br/>
            <p:inputMask value="#{gestorBean.gestor.documento.cpf}"
                         mask="999.999.999-99" size="18"
                         style="width: 90px"
                         required="true"
                         maxlength="14"/><br/>
        </h:panelGroup>
        <h:panelGroup>
            <h:outputLabel value="Ordenador" /><br/>
            <p:selectOneMenu value="#{gestorBean.gestor.ordenador}" 
                             style="width: 90px">
                <f:selectItem itemLabel="Selecione" />
                <f:selectItems value="#{gestorBean.ordenadores}" />
                <f:converter converterId="simpleEntityConverter" />
            </p:selectOneMenu>
        </h:panelGroup>
    </h:panelGrid>
    <h:panelGrid columns="2">
        <h:panelGroup>
            <h:outputLabel value="Ingresso" /><br/>
            <p:selectOneMenu value="#{gestorBean.gestor.ingresso}" 
                             style="width: 200px">
                <f:selectItem itemLabel="Selecione" />
                <f:selectItems value="#{gestorBean.ingressos}" />
                <f:converter converterId="simpleEntityConverter" />
            </p:selectOneMenu>
        </h:panelGroup>
        <h:panelGroup>
            <h:outputLabel value="Tipo de Serviço" /><br/>
            <p:selectOneMenu value="#{gestorBean.gestor.tipoServico}" 
                             style="width: 200px">
                <f:selectItem itemLabel="Selecione" />
                <f:selectItems value="#{gestorBean.tiposServico}" />
                <f:converter converterId="simpleEntityConverter" />
            </p:selectOneMenu>
        </h:panelGroup>
    </h:panelGrid>
    <h:panelGrid columns="2">
        <h:panelGroup>
            <h:outputText value="Expediênte" /><br/>
            <p:inputText value="#{gestorBean.gestor.expediente}"
                         styleClass="up"
                         style="width: 190px"
                         required="true"
                         maxlength="80"/><br/>
        </h:panelGroup>
        <h:panelGroup>
            <h:outputLabel value="Tipo de Cargo" /><br/>
            <p:selectOneMenu value="#{gestorBean.gestor.tipoCargo}" 
                             style="width: 200px">
                <f:selectItem itemLabel="Selecione" />
                <f:selectItems value="#{gestorBean.tiposCargo}" />
                <f:converter converterId="simpleEntityConverter" />
            </p:selectOneMenu>
        </h:panelGroup>
    </h:panelGrid>

    <hr/>

    <p:commandButton id="btnGravar" value="Gravar"
                     actionListener="#{gestorBean.adicionarEditarFim}"
                     update="formGestor" />

    <p:commandButton value="Cancelar"
                     actionListener="#{gestorBean.cancelar}"
                     immediate="true"/>

</h:form>


